/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wbd_au.objects_mappings;

import java.sql.SQLData;
import java.sql.SQLException;
import java.sql.SQLInput;
import java.sql.SQLOutput;

/**
 *
 * @author Iza
 */
public class Kwatera implements SQLData{
    
    int idKwatera;
    int iluOsobowa;
    int liczbaPokoi;
    int metrarz;
    String miasto;
    String ulica;
    int kodPocztowy;
    int nrDomu;
    int nrMieszkania;
        
  
    String sqlType;

    @Override
    public String getSQLTypeName() {
        return sqlType;
    }

    @Override
    public void readSQL(SQLInput stream, String typeName) throws SQLException {
        sqlType = typeName;

        idKwatera = stream.readInt();
        iluOsobowa = stream.readInt();
        liczbaPokoi = stream.readInt();
        metrarz = stream.readInt();
        miasto = stream.readString();
        ulica = stream.readString();
        kodPocztowy = stream.readInt();
        nrDomu = stream.readInt();
        nrMieszkania = stream.readInt();
          
    }

    @Override
    public void writeSQL(SQLOutput stream) throws SQLException {
       stream.writeInt(idKwatera);
       stream.writeInt(iluOsobowa);
       stream.writeInt(liczbaPokoi);
       stream.writeInt(metrarz);
       stream.writeString(miasto);
       stream.writeString(ulica);
       stream.writeInt(kodPocztowy);
       stream.writeInt(nrDomu);
       stream.writeInt(nrMieszkania);
   }
}
